package com.demo.event.service;

import com.demo.event.dto.UserLoginEvent;
import com.demo.event.dto.UserLoginEvent01;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 *
 * @author luoguoqiang
 * @since 2021/2/3
 */
@Component
@Slf4j
public class UserLoginListenByAnnotation {

  @EventListener
  public void onLoginSuccEvent(UserLoginEvent userLoginEvent){
    log.info("*********** 使用注解@EventListener， 接收到 UserLoginEvent 事件************** ");
    log.info("*********** 处理用户登录信息: {}", userLoginEvent);
    log.info("*********** UserLoginEvent 事件处理完毕************** ");
  }

}
